FROM registry.cn-hangzhou.aliyuncs.com/shiningrise/node:20.11.0 AS builder

WORKDIR /source

COPY package.json ./

#RUN npm config set registry https://registry.npm.taobao.org && npm install pnpm -g
RUN npm config set registry https://registry.npmmirror.com && npm install pnpm -g
RUN	pnpm config set registry https://registry.npmmirror.com/ 

RUN pnpm install

COPY . .

RUN pnpm run build

FROM registry.cn-hangzhou.aliyuncs.com/shiningrise/nginx:1.22.1

EXPOSE 80

WORKDIR /app/

COPY --from=builder /source/dist .

ENTRYPOINT ["nginx","-g","daemon off;"]
